/*
	WET-BOEW
	@title: Bootstrap overrides for WET-BOEW - Core CSS - forms
 */

/*! Placeholders */
%border-style-solid {
	border-style: solid;
}

/*
 *  Firefox-safe line height on input[type="reset|button|submit"]
 */

input {
	&[type="reset"],
	&[type="button"],
	&[type="submit"] {
		/*
		 *  Form control width
		 *
		 *  Default should be representative of the expected length of input.
		*  Full width should be only for cases when the expected length of input is
		*  greater than the available width.
		*  height:37px; rule of Bootstrap was overwritten by height: auto; first
		*  then a min-height specified, in order to address the issue #8492. July 2019.
		*/
		height: auto;
		min-height: 37px;

		&.btn-lg,
		&.input-lg {
			height: $input-height-large;
		}

		&.btn-sm,
		&.input-sm {
			height: $input-height-small;
		}

		&.btn-xs {
			height: $input-height-xs;
		}
	}
}

.form-control {
	height: auto;
	max-width: 100%;
	min-height: 37px;
	width: auto;
}

/*
 * Explicit labels for checkbox and radio button inputs
 *
 * Allow the use of horizontal explicit labels instead of the default implicit
 * labelling pattern for checkbox and radio button inputs provided by Bootstrap.
 */
.form-inline {
	.label-inline {
		position: relative;
		vertical-align: middle;

		label {
			font-weight: 400;
			margin-bottom: 0;
			padding-left: 2px;
		}
	}
}

/*
 *  Fieldset/legend border position
 *
 *  Bootstrap puts the border below the legend which creates a visual
 *  separation between the legend and the fields to which it relates. Putting
 *  the border above eliminates that visual separation. Putting it on the
 *  fieldset element instead ensures that all fieldsets will have a separation
 *  even when no legend is used.
 */
legend {
	border-bottom: 0;
	float: left;
}

fieldset {
	border-top: 1px solid $legend-border-color;
	padding-top: 10px;

	&:first-child {
		border-top: 0;
	}

	&[disabled] {
		.btn {
			@extend %border-style-solid;
		}
	}

	/*
	 *  Allows fieldSet/legend to have a bottom border under legend title
	 *  https://github.com/wet-boew/wet-boew/issues/7766
	 */
	&.legend-brdr-bttm {
		border-top: 0;

		legend {
			border-bottom: 1px solid $legend-border-color;
			float: none;
			margin-bottom: 10px;
		}
	}

	/*
	 *  Fieldset/legend as a label for a group of checkboxes or radio buttons
	 *  https://github.com/wet-boew/wet-boew/issues/5797
	 */
	&.chkbxrdio-grp {
		border-top: 0;
		padding-top: 0;

		legend {
			font-size: $font-size-base;
			font-weight: bold;
			margin-bottom: 5px;
		}
	}
}
